<?php session_start(); ?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">

<html>

<head>
<title>Parent Informer RCSHS - Request Lobby</title>
<link rel=stylesheet href="../css-layouts/themes/defaulttheme.css" type="text/css">
<link rel=stylesheet href="../css-layouts/headlinks.css" type="text/css">

<script type="text/javascript">
<!--
 var RecaptchaOptions = {
  theme : 'custom',
  custom_theme_widget: 'catcharea'
 };
//-->
</script>

</head>

<?php 

 /*
  * Use the ever-useful reCAPTCHA. The public
  * key here is for the domain http://localhost.
  */
 require_once("../modules/lib/recaptchalib.php");
 $catchpubkey = "6Leo8MMSAAAAANgHo9cksNq4o-O8nSGSHhp96XDz";

 mysql_connect("localhost", "root", "") or die(mysql_error()); 
 mysql_select_db("pinfdbshs") or die(mysql_error()); 

 //Checks if there is a login cookie
 if(isset($_COOKIE["parentinformerprcshs"]) || isset($_COOKIE["parentinformerurcshs"])) {
  if(isset($_COOKIE["parentinformerprcshs"])) {
   $username = $_COOKIE["parentinformerprcshs"]; 
  }
  else {
   $_SESSION['theerrcode'] = 2;
   header("Location: ../modules/logerr_atmpt.php");
  }
  $pass = $_COOKIE["parentinformerurcshs"];
  $check = mysql_query("SELECT * FROM logtbl WHERE usernm = '".$username."'") or die(mysql_error());
  while($info=mysql_fetch_array($check)) {
   if ($pass!=$info['pwrnd']) {
    $_SESSION['theerrcode'] = 2;
    header("Location: ../modules/logerr_atmpt.php");
   }
   else {
    header("Location: ../main.php");
   }
  }
 }
 else {

?>

<body>
<div id="mainhead"><br><br><br></div>

<br>
<center><span id="heading">Request for Account</span></center>
<br>

<form method=post action="../modules/acctmgnt/pendaccts/procacct.php">
<table align=center id="labelforms">

<tr>
<td>Username:</td>
<td><input type="text" name="desusrnm" size=29></td>
</tr>

<tr>
<td>Password:</td>
<td><input type="password" name="despaswrd" size=29></td>
</tr>

<tr>
<td>Confirm Password:</td>
<td><input type="password" name="confpaswrd" size=29></td>
</tr>

<tr>
<td>Status:</td>
<td>
<select name="despriv">
<option value=0 selected>Please select a privilege...</option>
<option value=1>ADMINISTRATOR/ADVISER</option>
<option value=2>SUBJECT TEACHER</option>
<option value=3>STUDENT</option>
</select>
</td>
</tr>

<tr>
<td>E-mail Address:</td>
<td><input type="text" name="mymail" size=29></td>
</tr>

<tr>
<td>Reason for Request:</td>
<td><textarea rows=5 cols=30 name="comnt"></textarea></td>
<tr>

<tr>
<td></td>

<td>

<!--
  This is the start of the reCAPTCHA custom theme code.
  -->
<div id="catcharea" style="display:none">
 <div id="recaptcha_image"></div><div class="recaptcha_only_if_incorrect_sol" style="color:red">Incorrect input. Please try again.</div>
 <span class="recaptcha_only_if_image">Input the words shown above separated by a space:</span>
 <span class="recaptcha_only_if_audio">Input the numbers you hear:</span>
 <br>
 <input type="text" id="recaptcha_response_field" name="recaptcha_response_field">
 <br>
 <a href="javascript:Recaptcha.reload()">RELOAD</a> || 
 <span class="recaptcha_only_if_image"><a href="javascript:Recaptcha.switch_type('audio')">AUDIO</a></span>
 <span class="recaptcha_only_if_audio"><a href="javascript:Recaptcha.switch_type('image')">IMAGE</a></span> ||
 <a href="javascript:Recaptcha.showhelp()">HELP</a>
</div>

<script type="text/javascript" src="http://www.google.com/recaptcha/api/challenge?k=<?php echo $catchpubkey; ?>">
</script>

<noscript>
 <iframe src="http://www.google.com/recaptcha/api/noscript?k=<?php echo $catchpubkey; ?>" height="300" width="500" frameborder="0">
 </iframe>
 <br>
 <textarea name="recaptcha_challenge_field" rows="3" cols="40">
 </textarea>
 <input type="hidden" name="recaptcha_response_field" value="manual_challenge">
</noscript>
<!--
  End of reCAPTCHA custom theme code.
  -->

</td>
</tr>

<tr>
<td></td>
<td><input type="submit" name="submitbtn" value="Request Account"></td>
</tr>

</table>
</form>

<div class="footnav" align=center>

<hr>

<a href="../">Main Page</a> ||
<b>Request Account</b> ||
<a href="#">Help</a> ||
<a href="#">Disclaimer</a> ||
<a href="links.php">Links</a> ||
<a href="#">About</a>
<br>

<span id="copyme">
&copy; 2011 Roosevelt College Science High School. All rights reserved.
</span>

</div>

</body>

<?php

 }

?>

</html>